<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>UVLogger Protocol Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1333)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">IJKMediaPlayer-static </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">UCloud</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/logFormatter">logFormatter</option>
		
		<option value="//api/name/loggerName">loggerName</option>
		
		<option value="//api/name/loggerQueue">loggerQueue</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/didAddLogger">- didAddLogger</option>
		
		<option value="//api/name/didAddLoggerInQueue:">- didAddLoggerInQueue:</option>
		
		<option value="//api/name/flush">- flush</option>
		
		<option value="//api/name/logMessage:NS_SWIFT_NAME:">- logMessage:NS_SWIFT_NAME:</option>
		
		<option value="//api/name/willRemoveLogger">- willRemoveLogger</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">UVLogger Protocol Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Conforms to</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>UVLog.h</td>
</tr>
						</tbody></table></div>
					

                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>This protocol describes a basic logger behavior.
Basically, it can log messages, store a <a href="#//api/name/logFormatter">logFormatter</a> plus a bunch of optional behaviors.
(i.e. <a href="#//api/name/flush">flush</a>, get its <a href="#//api/name/loggerQueue">loggerQueue</a>, get its name, &hellip;</p>
					</div>
					
					

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/logMessage:NS_SWIFT_NAME:" title="logMessage:NS_SWIFT_NAME:"></a>
	<h3 class="method-title"><code><a href="#//api/name/logMessage:NS_SWIFT_NAME:">&ndash;&nbsp;logMessage:NS_SWIFT_NAME:</a></code>
<span class="task-item-suffix">required method</span></h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>The log message method</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)logMessage:(UVLogMessage *)<em>logMessage</em> NS_SWIFT_NAME</code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>logMessage</code></th>
						<td><p>the message (model)</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/logFormatter" title="logFormatter"></a>
	<h3 class="method-title"><code><a href="#//api/name/logFormatter">&nbsp;&nbsp;logFormatter</a></code>
<span class="task-item-suffix">required method</span></h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Formatters may optionally be added to any logger.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, strong) id&lt;UVLogFormatter&gt; logFormatter</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>If no formatter is set, the logger simply logs the message as it is given in logMessage,
or it may use its own built in formatting style.</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/didAddLogger" title="didAddLogger"></a>
	<h3 class="method-title"><code><a href="#//api/name/didAddLogger">&ndash;&nbsp;didAddLogger</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Since logging is asynchronous, adding and removing loggers is also asynchronous.
In other words, the loggers are added and removed at appropriate times with regards to log messages.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)didAddLogger</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>Loggers will not receive log messages that were executed prior to when they were added.</li>
<li>Loggers will not receive log messages that were executed after they were removed.</li>
</ul>


<p>These methods are executed in the logging thread/queue.
This is the same thread/queue that will execute every logMessage: invocation.
Loggers may use these methods for thread synchronization or other setup/teardown tasks.</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/didAddLoggerInQueue:" title="didAddLoggerInQueue:"></a>
	<h3 class="method-title"><code><a href="#//api/name/didAddLoggerInQueue:">&ndash;&nbsp;didAddLoggerInQueue:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Since logging is asynchronous, adding and removing loggers is also asynchronous.
In other words, the loggers are added and removed at appropriate times with regards to log messages.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)didAddLoggerInQueue:(dispatch_queue_t)<em>queue</em></code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>Loggers will not receive log messages that were executed prior to when they were added.</li>
<li>Loggers will not receive log messages that were executed after they were removed.</li>
</ul>


<p>These methods are executed in the logging thread/queue given in parameter.
This is the same thread/queue that will execute every logMessage: invocation.
Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function.</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/willRemoveLogger" title="willRemoveLogger"></a>
	<h3 class="method-title"><code><a href="#//api/name/willRemoveLogger">&ndash;&nbsp;willRemoveLogger</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>See the above description for <code>didaddLoger</code></p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)willRemoveLogger</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/flush" title="flush"></a>
	<h3 class="method-title"><code><a href="#//api/name/flush">&ndash;&nbsp;flush</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Some loggers may buffer IO for optimization purposes.
For example, a database logger may only save occasionaly as the disk IO is slow.
In such loggers, this method should be implemented to flush any pending IO.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)flush</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>This allows invocations of UVLog&rsquo;s flushLog method to be propogated to loggers that need it.</p>

<p>Note that UVLog&rsquo;s flushLog method is invoked automatically when the application quits,
and it may be also invoked manually by the developer prior to application crashes, or other such reasons.</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loggerQueue" title="loggerQueue"></a>
	<h3 class="method-title"><code><a href="#//api/name/loggerQueue">&nbsp;&nbsp;loggerQueue</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Each logger is executed concurrently with respect to the other loggers.
Thus, a dedicated dispatch queue is used for each logger.
Logger implementations may optionally choose to provide their own dispatch queue.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggerQueue</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loggerName" title="loggerName"></a>
	<h3 class="method-title"><code><a href="#//api/name/loggerName">&nbsp;&nbsp;loggerName</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>If the logger implementation does not choose to provide its own queue,
one will automatically be created for it.
The created queue will receive its name from this method.
This may be helpful for debugging or profiling reasons.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSString *loggerName</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">UVLog.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2017 UCloud. All rights reserved. Updated: 2017-04-18</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1333)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>